
$(document).ready(function() {
    setInterval('imageRotator()', 4000);
});

function imageRotator() {
    var curImg = $('.fr_slide li.current');
    var nextImg = curImg.next();

    if (nextImg.length == 0) {
        nextImg = $('.fr_slide li:first');
    };

    curImg.removeClass('current').addClass('previous');
    nextImg.css({opacity:0}).addClass('current').animate({opacity:1}, 1000, function() {
        curImg.removeClass('previous');
    });


};
